30 PRINT TAB(8);"The binomial distribution provides a one-tailed exact test":PRINT "applicable when a dichotomous variable has an equal probability of occurring":PRINT TAB(27);"in each of N trials.":PRINT:AR=9:AC=56
125 IF PS=0.5 THEN P=P*2:PRINT TAB(20);"Two-tailed probability ";:GOSUB 155
130 IF NT*PS<10 OR NT*QS<10 OR P>0.05 THEN 145 ELSE P$=".#####"
135 PRINT:PRINT:PRINT TAB(15);"The observed proportion of successes is ";:PRINT USING P$;NO/NT
140 PRINT TAB(8);"Confidence limits can be calculated as: ";:PRINT USING P$;NO/NT;:PRINT " +/- Z * ";:PRINT USING P$;SQR(PS*QS/NT)
145 LOCATE 25,10:INPUT;"Do you want to perform another binomial calculation? ",A$:IF A$="y" OR A$="Y" THEN 20
150 LOCATE 23,1:END
155 IF P<9.99E-07 THEN PRINT "< 10 (-6)"; ELSE IF P>0.95 THEN PRINT "> .95"; ELSE PRINT "= ";P;
160 RETURN
165 LOCATE 25,24:PRINT "Please enter integers only.";
170 BEEP:LOCATE AR,AC:PRINT " ":RETURN
5000 BEEP:IF ERR<>53 AND ERR<>71 THEN 5010 ELSE LOCATE 10,10:PRINT "Please place EPISTAT in drive A: (or other default).":PRINT TAB(25);"Press any key to continue:"